import sys
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (
    QVBoxLayout,
    QHBoxLayout,
    QGridLayout,
    QApplication,
    QMainWindow,
    QPushButton,
    QLabel,
    QWidget,
)


def main():
    app = QApplication(sys.argv)
    # create window

    # window = QMainWindow()
    window = QWidget()
    window.resize(1200, 1200)
    window.setWindowTitle("Hello World")
    # layout = QVBoxLayout()
    # layout = QHBoxLayout()
    layout = QGridLayout()
    label = QLabel("Hello World0")
    label.setStyleSheet("background-color: red;text-align: center;")
    # label.setAlignment(Qt.AlignCenter)
    label1 = QLabel("Hello World1")
    label1.setStyleSheet("background-color: yellow;")
    label2 = QLabel("Hello World2")
    label2.setStyleSheet("background-color: blue;")
    label3 = QLabel("Hello World3")
    label3.setStyleSheet("background-color: grey;")
    layout.addWidget(label, 0, 0, 1, 3)
    layout.addWidget(label1, 0, 2)
    layout.addWidget(label2, 1, 2)
    layout.addWidget(label3, 1, 1)
    # label4 = QLabel("Hello World4", window)
    # label5 = QLabel("Hello World5", window)
    button = QPushButton("Click me")
    # button.clicked.connect(lambda: button_clicked(label))
    button.clicked.connect(lambda: label.setText("Button clicked"))
    # layout.addWidget(label, 0, 0, 2, 3, alignment=Qt.AlignLeft | Qt.AlignTop)
    # layout.addWidget(label1, 0, 2)
    # layout.addWidget(label2, 1, 0)
    # layout.addWidget(label3, 2, 1, 2, 1)
    # layout.addWidget(label4)
    # layout.addWidget(label5)
    # layout.addWidget(button)
    window.setLayout(layout)
    window.show()

    sys.exit(app.exec_())


def button_clicked(label):
    print("Button clicked")
    label.setText("Button clicked")


if __name__ == "__main__":
    main()
